//
//  ViewController.m
//  Xib_拉钩登录界面
//
//  Created by dllo on 16/7/28.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@property (weak, nonatomic) IBOutlet UIImageView *logoImageView;

@property (weak, nonatomic) IBOutlet UIView *usernameView;

@property (weak, nonatomic) IBOutlet UIView *pasewordView;

@property (weak, nonatomic) IBOutlet UIImageView *usernameImageView;

@property (weak, nonatomic) IBOutlet UIImageView *passwordImageView;

@property (weak, nonatomic) IBOutlet UITextField *usernameTextField;

@property (weak, nonatomic) IBOutlet UITextField *passwordTextField;

@property (weak, nonatomic) IBOutlet UIButton *loginButton;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setViews];
}

- (void)setViews
{
    // username view add radius
    UIBezierPath *maskPathUser = [UIBezierPath bezierPathWithRoundedRect:_usernameView.bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight) cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer *maskLayerUser = [[CAShapeLayer alloc]init];
    maskLayerUser.frame = _usernameView.bounds;
    maskLayerUser.path = maskPathUser.CGPath;
    _usernameView.layer.masksToBounds = YES;
    _usernameView.layer.mask = maskLayerUser;
    
    // password view add radius
    UIBezierPath *maskPathPaseword = [UIBezierPath bezierPathWithRoundedRect:_pasewordView.bounds byRoundingCorners:(UIRectCornerBottomLeft | UIRectCornerBottomRight) cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer *maskLayerPaseWord = [[CAShapeLayer alloc]init];
    maskLayerPaseWord.frame = _pasewordView.bounds;
    maskLayerPaseWord.path = maskPathPaseword.CGPath;
    _pasewordView.layer.masksToBounds = YES;
    _pasewordView.layer.mask = maskLayerPaseWord;
    
    // login button add radius
    _loginButton.layer.cornerRadius = 10;
    
    // image view
    _logoImageView.contentMode = UIViewContentModeScaleAspectFill;
    _usernameImageView.contentMode = UIViewContentModeCenter;
    _passwordImageView.contentMode = UIViewContentModeCenter;
}



- (IBAction)usernameTextField:(id)sender {
}

- (IBAction)passwordTextField:(id)sender {
}

- (IBAction)loginButton:(id)sender {
}

- (IBAction)registerButton:(id)sender {
}

- (IBAction)randomButton:(id)sender {
}

- (IBAction)losePasswordButton:(id)sender {
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
